package com.ruicar.afs.cloud.manage.common.controller;

import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.parameter.commom.entity.TsysAddressParam;
import com.ruicar.afs.cloud.parameter.commom.service.TsysAddressParamService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Lee
 * @date: 2020/5/11 19:39
 * @description: 地址库查询
 */
@Slf4j
@RestController
@RequestMapping("/sysAddressParam")
@AllArgsConstructor
public class SysAddressParamController {
    private TsysAddressParamService tsysAddressParamService;

    @ApiOperation(value = "根据合同号码、案件编号查询审批历史信息")
    @PostMapping("/translateAddress")
    public IResponse<TsysAddressParam> findByContractNo(@RequestParam("code") String code){
        TsysAddressParam tsysAddressParam = tsysAddressParamService.getProvinceOrCtiy(code);
        return new IResponse<TsysAddressParam>().setData(tsysAddressParam);
    }
}
